package study.lxy.spring.springboot2.utils.exception;

import study.lxy.spring.springboot2.utils.consts.ErrorCode;

public class BussiException extends RuntimeException {

    private String code;

    public BussiException(String code,String message){
        super(message);
        this.code = code;
    }

    public BussiException(ErrorCode errorCode){
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }

    public String getCode(){
        return code;
    }
}
